﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Epona.Domain.Query.Impl
{
    public abstract class SizeCompareCriterion:BasicCriterion
    {
        public int Value { private set; get; }
        public string Operator { set; private get; }

        public SizeCompareCriterion(string propName,int value)
            :base(propName)
        {
            this.Value = value;
        }

        public override string ToQueryString()
        {
            return "size(" + GetPropNameWithAlias() + ")" + Operator + GetParamNameWithColon();
        }

        public override NamedParameters GetParameters()
        {
            return NamedParameters.Create().Add(GetParamName(), Value);
        }
    }
}
